package com.du.demo.service;


import com.du.demo.entity.Employee;
import com.du.demo.mapper.EmployeeMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeService {


    @Resource
    EmployeeMapper employeeMapper;

    public PageInfo<Employee> setAll(Integer pageNum,Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Employee> employees=employeeMapper.selectAll();
        return new PageInfo<>(employees);
    }

    public Object setById(Integer id) {
        return employeeMapper.setById(id);
    }
}
